package freedom.ms;

import java.text.MessageFormat;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.web.bind.annotation.RequestMapping;

@SpringBootApplication
@EnableConfigServer
public class ConfigServerApp 
{
    public static void main( String[] args )
    {
    	SpringApplication.run(ConfigServerApp.class, args);
    }
    
	@Value("${spring.application.name}")
	String name;
	@Value("${server.port}")
	String port;

	@RequestMapping("/info")
	public String info() {
		return MessageFormat.format("{0} {1}", name, port);
	}
}
